package com.example.footprint;

import java.util.ArrayList;
import java.util.HashMap;

import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;

public class MessageDisplayActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_message_display);
		ListView listView = (ListView) findViewById(R.id.ListView1);
		ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
		for (int i = 0; i < 10; i++) {
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("MSMImage", R.drawable.important);
			map.put("MSMCreator", "User "+i);  
            map.put("MSMDetails", "This is message No. " + i);
            listItem.add(map);
		}
		SimpleAdapter listItemAdapter = new SimpleAdapter(this, listItem, R.layout.list_item, new String[] {"MSMImage", "MSMCreator", "MSMDetails"}, 
				new int[] {R.id.ItemImage, R.id.ItemTitle, R.id.ItemText});
		listView.setAdapter(listItemAdapter);
	}

	
}
